package com.monolithiot.sso.common.entity;

import com.monolithiot.sso.common.context.Constants;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 2018/12/30 Create by 郭文梁
 * UserGroup
 * 用户组实体类
 *
 * @author 郭文梁
 * @date 2018/12/30
 */
@Data
@Table(name = "tb_user_group")
public class UserGroup {
    /**
     * ID
     * id          INT(10)      NOT NULL AUTO_INCREMENT
     * COMMENT '主键ID',
     * PRIMARY KEY (id)
     */
    @Id
    @GeneratedValue(generator = Constants.SQL.GENERATOR_JDBC)
    @Column(name = "id", length = 10, nullable = false)
    private Integer id;
    /**
     * name        VARCHAR(255) NOT NULL
     * COMMENT '用户组名称',
     */
    @Column(name = "name", nullable = false)
    private String name;
    /**
     * id_number   VARCHAR(20)  NOT NULL
     * COMMENT '用户组号码',
     */
    @Column(name = "id_number", length = 20, nullable = false)
    private String idNumber;
    /**
     * creator_id  INT(10)      NOT NULL
     * COMMENT '创建者ID',
     */
    @Column(name = "creator_id", length = 10, nullable = false)
    private Integer creatorId;
    /**
     * 创建者用户实体对象
     */
    private User creator;
    /**
     * description VARCHAR(255) NULL
     * COMMENT '描述',
     */
    @Column(name = "description", nullable = false)
    private String description;
}
